$('.rule-entity-deploy').closest('form').on('ajax:success', function() {
    alert("Validate rule <%= @result ? @result[:err_msg] : 'failed' %>.");
});
